#ifndef CLIENTSERVER_H
#define CLIENTSERVER_H

#include <QObject>
#include <QTcpSocket>
#include <QString>

class ClientServer : public QObject
{
    Q_OBJECT
public:
    explicit ClientServer(QObject *parent = 0);
    ~ClientServer();
    bool connectToServer(QString cStrIp, int iPort);
    bool disconnectFromServer();
    bool reconnect();
public:
    int m_iTimeOutMS;
    bool m_ready;
    QString m_cStrIp;
    int m_iPort;

    QTcpSocket m_server;
signals:
    void sig_connected();
    void sig_disconnected();
private slots:
    void slot_connected();
    void slot_disconnected();
    void slot_error(QAbstractSocket::SocketError socketError);
};

#endif // CLIENTSERVER_H
